/**
 * Created by Veronica on 2017/3/19.
 */
package package05;
public class MethodDemo03 {
    public static void main(String[] args) {
        System.out.println(addNum(100));
    }
    /*
    * 从1+100；100+99+98+
    * */
    public  static int addNum(int num){
        if (num == 1) {  //程序出口
            return 1;
        }else {
            return num+addNum(num-1);
        }
    }
}
